/*
 bnkit -- software for building and using Bayesian networks
 Copyright (C) 2014  M. Boden et al.

 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package bn.ctmc.matrix;

import dat.Enumerable;
import bn.ctmc.SubstModel;

/**
 *
 * @author mikael
 */
public class WAG extends SubstModel {
    // WAG model of amino acid evolution
    // Whelan, S. and N. Goldman. Molecular Biology and Evolution. 18(5):691-699, 2001.
    
    public static Character[] S = {'A','R','N','D','C','Q','E','G','H','I','L','K','M','F','P','S','T','W','Y','V'};

    public static double[] F = {
      //A       R       N       D       C   	Q       E       G       H       I  	L       K       M       F       P       S       T       W       Y       V
        0.0866, 0.0440, 0.0391, 0.0570, 0.0193, 0.0367, 0.0581, 0.0833, 0.0244, 0.0485, 0.0862, 0.0620, 0.0195, 0.0384, 0.0458, 0.0695, 0.0610, 0.0144, 0.0353, 0.0709};
    
    public static double[][] Q = {
   //  A         C         D         E         F         G         H         I         K         L         M         N         P         Q         R         S         T         V         W         Y          
    {0.000000, 0.610810, 0.569079, 0.821500, 1.141050, 1.011980, 1.756410, 1.572160, 0.354813, 0.219023, 0.443935, 1.005440, 0.989475, 0.233492, 1.594890, 3.733380, 2.349220, 0.125227, 0.268987, 2.221870}, 
    {0.000000, 0.000000, 0.711690, 0.165074, 0.585809, 3.360330, 0.488649, 0.650469, 2.362040, 0.206722, 0.551450, 5.925170, 0.758446, 0.116821, 0.753467, 1.357640, 0.613776, 1.294610, 0.423612, 0.280336}, 
    {0.000000, 0.000000, 0.000000, 6.013660, 0.296524, 1.716740, 1.056790, 1.253910, 4.378930, 0.615636, 0.147156, 3.334390, 0.224747, 0.110793, 0.217538, 4.394450, 2.257930, 0.078463, 1.208560, 0.221176}, 
    {0.000000, 0.000000, 0.000000, 0.000000, 0.033379, 0.691268, 6.833400, 0.961142, 1.032910, 0.043523, 0.093930, 0.533362, 0.116813, 0.052004, 0.472601, 1.192810, 0.417372, 0.146348, 0.363243, 0.169417}, 
    {0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.109261, 0.023920, 0.341086, 0.275403, 0.189890, 0.428414, 0.083649, 0.437393, 0.441300, 0.122303, 1.560590, 0.570186, 0.795736, 0.604634, 1.114570}, 
    {0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 6.048790, 0.366510, 4.749460, 0.131046, 0.964886, 4.308310, 1.705070, 0.110744, 1.036370, 1.141210, 0.954144, 0.243615, 0.252457, 0.333890}, 
    {0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.630832, 0.635025, 0.141320, 0.172579, 2.867580, 0.353912, 0.092310, 0.755791, 0.782467, 0.914814, 0.172682, 0.217549, 0.655045}, 
    {0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.276379, 0.034151, 0.068651, 0.415992, 0.194220, 0.055288, 0.273149, 1.486700, 0.251477, 0.374321, 0.114187, 0.209108}, 
    {0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.152215, 0.555096, 0.992083, 0.450867, 0.756080, 0.771387, 0.822459, 0.525511, 0.289998, 4.290350, 0.131869}, 
    {0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 3.517820, 0.360574, 4.714220, 1.177640, 0.111502, 0.353443, 1.615050, 0.234326, 0.468951, 8.659740}, 
    {0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.287583, 5.375250, 2.348200, 0.462018, 0.382421, 0.364222, 0.740259, 0.443205, 1.997370}, 
    {0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.032220, 0.098843, 0.619503, 1.073780, 1.537920, 0.152232, 0.147411, 0.342012}, 
    {0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.320870, 0.194864, 0.556353, 1.681970, 0.570369, 0.473810, 2.282020}, 
    {0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.179896, 0.606814, 0.191467, 1.699780, 7.154480, 0.725096}, 
    {0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.786490, 0.885349, 0.156619, 0.239607, 0.351250}, 
    {0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 4.847130, 0.578784, 0.872519, 0.258861}, 
    {0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.126678, 0.325490, 1.547670}, 
    {0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 2.763540, 0.409817}, 
    {0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.347826},
    {0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000}}; 

    public WAG() {
        super(F, Q, new Enumerable(S));
    }
    
    public String getName() {
        return "WAG";
    }

}
